# MakeBy: LiuBoyuan
from sqlalchemy import Column, Integer, String, Enum, ForeignKey
from sqlalchemy.orm import relationship
from sqlalchemy.ext.declarative import declarative_base




Base = declarative_base()

class GameDetailModel(Base):
    __tablename__ = 'game_detail'

    game_id = Column(Integer, primary_key=True ,autoincrement=True)
    game_name = Column(String(100))
    game_info = Column(String(255))
    game_extends_id = Column(Integer, ForeignKey('game_detail.game_id'))
    allow_second_create = Column(Enum('Token', 'Yes', 'Impo', 'No', name='allow_second_create_enum'), default='No')
    token = Column(String(255))
    game_image = Column(String(255))
    game_type = Column(Enum('private','public', name='game_type'), default='private')
    author = Column(Integer)

    sub_details = relationship('GameDetailModel')